package com.baseandroid.config;

import com.baseandroid.push.BuriedEventPacket;
import com.baseandroid.retrofit.json.Data;
import com.qianbao.qianbaobusiness.json.AliPayResultBean;
import com.qianbao.qianbaobusiness.json.AlphaZone;
import com.qianbao.qianbaobusiness.json.ApplyDownLoadCount;
import com.qianbao.qianbaobusiness.json.BusinessAnalysisBean;
import com.qianbao.qianbaobusiness.json.CashierBean;
import com.qianbao.qianbaobusiness.json.CashierDetailBean;
import com.qianbao.qianbaobusiness.json.ChannelBean;
import com.qianbao.qianbaobusiness.json.CheckUpdate;
import com.qianbao.qianbaobusiness.json.CustomerManagerBean;
import com.qianbao.qianbaobusiness.json.EInvoiceDetailBean;
import com.qianbao.qianbaobusiness.json.EInvoiceListBean;
import com.qianbao.qianbaobusiness.json.EInvoiceListHeadBean;
import com.qianbao.qianbaobusiness.json.EmsStatus;
import com.qianbao.qianbaobusiness.json.FeedBackTagBean;
import com.qianbao.qianbaobusiness.json.HelpBean;
import com.qianbao.qianbaobusiness.json.MerchantActivityBean;
import com.qianbao.qianbaobusiness.json.MerchantAdvertsBean;
import com.qianbao.qianbaobusiness.json.MerchantCollegeBean;
import com.qianbao.qianbaobusiness.json.MerchantQrCodeBean;
import com.qianbao.qianbaobusiness.json.MerchantsBean;
import com.qianbao.qianbaobusiness.json.MessageListBean;
import com.qianbao.qianbaobusiness.json.PcdBean;
import com.qianbao.qianbaobusiness.json.QRCardPayBean;
import com.qianbao.qianbaobusiness.json.SaveQrcodeBean;
import com.qianbao.qianbaobusiness.json.ServerTime;
import com.qianbao.qianbaobusiness.json.SettlementInfoBean;
import com.qianbao.qianbaobusiness.json.ShopListInfo;
import com.qianbao.qianbaobusiness.json.StoreInfoBean;
import com.qianbao.qianbaobusiness.json.UnPayShopListBean;
import com.qianbao.qianbaobusiness.json.UnPayinfoParentBean;
import com.qianbao.qianbaobusiness.json.UnReadMsgBean;
import com.qianbao.qianbaobusiness.json.UserInfo;
import com.qianbao.qianbaobusiness.json.UserTokenInfo;
import com.qianbao.qianbaobusiness.json.WechatAppExistsBean;
import com.qianbao.qianbaobusiness.json.WechatAppQrBean;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface MyApi {

    /**
     * 获取服务器时间
     */
    @GET("v1/basic/get_server_time")
    Observable<Data<ServerTime>> getServerTime();

    /**
     * 刷新Token
     */
    @GET("v1/token/refresh_token")
    Observable<Data<UserTokenInfo>> refreshToken(@QueryMap Map<String, String> refreshMap);

    /**
     * 获取app版本信息
     */
    @FormUrlEncoded
    @POST("v1/basic/get_app_config")
    Observable<Data<CheckUpdate>> checkUpdate(@FieldMap Map<String, String> updateMap);

    /**
     * 获取用户信息
     */
    @GET("v1/mermng/basic/get_user_info")
    Observable<Data<UserInfo>> getUserinfo();

    /**
     * 获取短信验证码
     */
    @GET("v1/mermng/basic/get_login_check_code")
    Observable<Data> getSmsCode(@QueryMap Map<String, String> paramMap);

    /**
     * 登录
     */
    @GET("v1/mermng/basic/login")
    Observable<Data<UserTokenInfo>> requestLogin(@QueryMap Map<String, String> paramMap);

    /**
     * 获取各店铺信息
     */
    @GET("v1/mermng/allcoupon/find_rightmenu_list")
    Observable<Data<ShopListInfo>> getUserShopListInfo();

    /**
     * 获取电子发票统计数据
     */
    @GET("v1/mermng/invoice/get_invoice_count")
    Observable<Data<EInvoiceListHeadBean>> getInvoiceCount();

    /**
     * 获取电子发票列表
     */
    @FormUrlEncoded
    @POST("v1/mermng/invoice/get_invoice_list")
    Observable<Data<EInvoiceListBean>> getInvoiceList(@Field("pos") String pos, @Field("limit") String limit);

    /**
     * 获取电子发票详情
     */
    @FormUrlEncoded
    @POST("v1/mermng/invoice/get_invoice_detail")
    Observable<Data<EInvoiceDetailBean>> getInvoiceDetail(@Field("invoiceId") String invoiceId);

    /**
     * 作废电子发票
     */
    @FormUrlEncoded
    @POST("v1/mermng/invoice/update_invalid_invoice")
    Observable<Data> invalidInvoice(@Field("invoiceId") String invoiceId);

    /**
     * 客户经理列表
     */
    @FormUrlEncoded
    @POST("v1/mermng/allcoupon/find_allsalemanager_list")
    Observable<Data<CustomerManagerBean>> getManagerList(@Field("pos") String pos, @Field("limit") String s);

    /**
     * 收银列表
     *
     * @param merchantNos
     * @param date
     * @param statusValue
     * @param typeValue
     * @param pageNum
     * @param pageSize
     * @return
     */
    @FormUrlEncoded
    @POST("v1/mermng/trade/getOrderList")
    Observable<Data<CashierBean>> getOrderList(@FieldMap Map<String, String> paramMap);

    /**
     * 根据商户号，订单号查询订单详情
     *
     * @param merchantNo
     * @param orderNo
     * @return
     */
    @FormUrlEncoded
    @POST("v1/mermng/trade/getOrderInfo")
    Observable<Data<CashierDetailBean>> getOrderInfo(@Field("merchantno") String merchantNo, @Field("orderno") String orderNo);

    /**
     * 查询未读消息数
     */
    @FormUrlEncoded
    @POST("v1/mermng/message/unread_msg_num")
    Observable<Data<UnReadMsgBean>> getMsgUnread(@FieldMap Map<String, String> paramMap);

    @FormUrlEncoded
    @POST("v1/mermng/trade/getOrderList")
    Observable<Data<CashierBean>> getTotalStatics(@FieldMap Map<String, String> paramMap);

    /**
     * 获取经营分析数据
     *
     * @param merchantNo 商户号（多商户用","分开）
     */
    @FormUrlEncoded
    @POST("v1/mermng/trade/get_manage_statis")
    Observable<Data<BusinessAnalysisBean>> getManagerStatic(@Field("merNos") String merchantNo);

    /**
     * 用户登出
     */
    @GET("v1/mermng/basic/logout")
    Observable<Data> logOut();

    /**
     * 更新推送audience
     */
    @FormUrlEncoded
    @POST("v1/mermng/basic/update_push_audience")
    Observable<Data> updatePushAudience(@FieldMap Map<String, String> params);


    /**
     * 拉取所有帮助列表
     */
    @POST("v1/basic/help/list_visible")
    Observable<Data<HelpBean>> getHelpCenterListList();

    /**
     * 更新email地址
     */
    @GET("v1/mermng/basic/set_user_email")
    Observable<Data> setUserEmail(@QueryMap Map<String, String> params);

    /**
     * 获取结算信息
     */
    @POST("v1/mermng/allcoupon/find_allsettlement_list")
    Observable<Data<SettlementInfoBean>> getSettlementList();

    /**
     * 获取店铺信息
     */
    @POST("v1/mermng/allcoupon/find_allmerchant_list")
    Observable<Data<StoreInfoBean>> getStoreInfo();

    /**
     * 检查微信小程序
     */
    @FormUrlEncoded
    @POST("v1/mermng/wechat/applet/isexistswxacode")
    Observable<Data<WechatAppExistsBean>> checkWechatQrcode(@Field("merchantnolist") String merchantListString);

    /**
     * 查看微信小程序二维码
     */
    @FormUrlEncoded
    @POST("v1/mermng/wechat/applet/getwxacode")
    Observable<Data<WechatAppQrBean>> getWechatQrcode(@Field("merchantno") String merchantNo);

    /**
     * 生成微信小程序二维码
     */
    @FormUrlEncoded
    @POST("v1/mermng/wechat/applet/batchopenwxacode")
    Observable<Data<WechatAppQrBean>> creatQrcode(@Field("merchantnolist") String merchantListString, @Field("selected") String merchantNo);

    /**
     * 推送埋点统计
     */
    @POST("v1/basic/report/report_data")
    Observable<Data> pushReportData(@Body BuriedEventPacket buriedEventPacket);

    /**
     * 获取首页广告
     */
    @FormUrlEncoded
    @POST("v1/mermng/advert/get_merchants_adverts")
    Observable<Data<MerchantAdvertsBean>> getMerchantsAdverts(@Field("positionId") String s);

    /**
     * 获取春风零费率信息
     */
    @POST("v1/mermng/zero/rate/get_activity_merchant")
    Observable<Data<MerchantActivityBean>> getMerchantActivity();

    /**
     * 获取商家学院Url
     */
    @FormUrlEncoded
    @POST("v1/basic/get_app_config")
    Observable<Data<MerchantCollegeBean>> getMerchantCollegeUrl(@Field("classcode") String classcode);

    /**
     * 获取消息列表
     */
    @FormUrlEncoded
    @POST("v1/mermng/message/user_msg_list")
    Observable<Data<MessageListBean>> getUserMsgList(@FieldMap Map<String, String> params);

    /**
     * 设置消息已读
     */
    @FormUrlEncoded
    @POST("v1/mermng/message/set_msg_read")
    Observable<Data> setMessageRead(@FieldMap Map<String, String> params);

    /**
     * 设置消息删除
     */
    @FormUrlEncoded
    @POST("v1/mermng/message/delete_msg")
    Observable<Data> setMessageDelet(@FieldMap Map<String, String> params);


    /**
     * 发送邮箱
     *
     * @param historyTyp
     * @param date
     * @param date1
     * @param merchantNos
     * @param userNo
     * @param email
     * @return
     */
    @FormUrlEncoded
    @POST("v1/mermng/settle/send_mail")
    Observable<Data<EmsStatus>> sendEmail(@Field("dateTp") String historyTyp, @Field("startDate")
            String date, @Field("endDate") String date1, @Field("merchantNo") String merchantNos, @Field("userNo") String userNo, @Field("receiver") String email);

    /**
     * 获取省市区数据
     *
     * @param version
     * @return
     */
    @GET("v1/basic/get_province_city_district")
    Observable<Data<PcdBean>> getDistrict(@Query("version") String version);

    /**
     * 获取二维码列表
     *
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("v1/mermng/code/find_merchant_qrcode_list")
    Observable<Data<MerchantQrCodeBean>> findMerchantQrcodeList(@FieldMap Map<String, String> params);

    /**
     * 根据类型和商户号获取二维码图片地址
     *
     * @return
     */
    @FormUrlEncoded
    @POST("v1/mermng/code/save_qrcode")
    Observable<Data<SaveQrcodeBean>> saveQrcode(@FieldMap Map<String, String> params);

    /**
     * 创建寄送订单
     *
     * @param parms
     */
    @FormUrlEncoded
    @POST("v1/mermng/code/create_order")
    Observable<Data<QRCardPayBean>> createOrder(@FieldMap HashMap<String, String> parms);

    /**
     * <<<<<<< HEAD
     * 根据id解绑二维码
     *
     * @param id
     * @return
     */
    @FormUrlEncoded
    @POST("v1/mermng/code/merchant_qrcode_remove_bind")
    Observable<Data> merchantQrcodeRemoveBind(@Field("id") String id);

    /**
     * 根据商户号和二维码密文绑定二维码
     *
     * @param merchantNo
     * @param contents
     * @return
     */
    @FormUrlEncoded
    @POST("v1/mermng/code/merchant_qrcode_bind")
    Observable<Data> merchantQrcodeBind(@Field("merchantNo") String merchantNo,
                                                @Field("qrCodeEncry") String contents);

    @FormUrlEncoded
    @POST("v1/basic/get_push_config")
    Observable<Data<ChannelBean>> getAppPushconfig(@FieldMap HashMap<String, String> parms);

    /**
     * 更新推送配置
     */
    @FormUrlEncoded
    @POST("v1/mermng/basic/update_push_audience")
    Observable<Data> updataAppPushconfig(@FieldMap HashMap<String, String> parms);

    /**
     * 获取灰度地区
     */
    @FormUrlEncoded
    @POST("v1/basic/get_app_config")
    Observable<Data<AlphaZone>> getAppAlphaZone(@FieldMap Map<String, String> updateMap);

    /**
     * 获取广告图片Url
     */
    @GET("v1/mermng/advert/get_merchants_adverts")
    Observable<Data<MerchantAdvertsBean>> getAppAdvertImg(@QueryMap Map<String, String> paras);

    @FormUrlEncoded
    @POST("v1/mermng/deposit/get_merchant_payment_info")
    Observable<Data<UnPayinfoParentBean>> getMerchantPaymentInfo(@Field("afterid") String afterId);


    @FormUrlEncoded
    @POST("v1/mermng/deposit/get_merchant_deposit_info")
    Observable<Data<MerchantsBean>> getMerchantDepositInfo(@Field("merchantNo") String s);

    @FormUrlEncoded
    @POST("v1/basic/feedback/tag_list")
    Observable<Data<FeedBackTagBean>> getFeedbackTags(@Field("sceneId") String sceneId);

    @FormUrlEncoded
    @POST("v1/mermng/deposit/get_merchant_unpay_deposit_info")
    Observable<Data<UnPayShopListBean>> getMerchantUnpayDepositInfo(@Field("merchantNos") String merchantNos);


    @FormUrlEncoded
    @POST("v1/basic/feedback/save")
    Observable<Data> submitFeedback(@FieldMap Map<String, String> params);

    /**
     * 获取剩余下载次数
     */
    @POST("v1/mermng/code/get_qrcode_download_count")
    Observable<Data<ApplyDownLoadCount>> getQrcodeDownloadCount();

    /**
     * 根据订单id查询订单支付状态
     * @param id
     * @return
     */
    @FormUrlEncoded
    @POST("v1/mermng/code/get_order_by_id")
    Observable<Data<AliPayResultBean>> getOrderById(@Field("id") String id);
}

